// FinanceDoc.cpp : implementation of the CFinanceDoc class
//

#include "stdafx.h"
#include "Finance.h"

#include "FinanceDoc.h"

#ifdef _DEBUG
#define new DEBUG_NEW
#undef THIS_FILE
static char THIS_FILE[] = __FILE__;
#endif

/////////////////////////////////////////////////////////////////////////////
// CFinanceDoc

IMPLEMENT_DYNCREATE(CFinanceDoc, CDocument)

BEGIN_MESSAGE_MAP(CFinanceDoc, CDocument)
	//{{AFX_MSG_MAP(CFinanceDoc)
		// NOTE - the ClassWizard will add and remove mapping macros here.
		//    DO NOT EDIT what you see in these blocks of generated code!
	//}}AFX_MSG_MAP
END_MESSAGE_MAP()

/////////////////////////////////////////////////////////////////////////////
// CFinanceDoc construction/destruction

CFinanceDoc::CFinanceDoc()
{
	// TODO: add one-time construction code here

}

CFinanceDoc::~CFinanceDoc()
{
}

BOOL CFinanceDoc::OnNewDocument()
{
	if (!CDocument::OnNewDocument())
		return FALSE;

	// TODO: add reinitialization code here
	// (SDI documents will reuse this document)

	return TRUE;
}



/////////////////////////////////////////////////////////////////////////////
// CFinanceDoc serialization

void CFinanceDoc::Serialize(CArchive& ar)
{
	if (ar.IsStoring())
	{
		// TODO: add storing code here
	}
	else
	{
		// TODO: add loading code here
	}
}

/////////////////////////////////////////////////////////////////////////////
// CFinanceDoc diagnostics

#ifdef _DEBUG
void CFinanceDoc::AssertValid() const
{
	CDocument::AssertValid();
}

void CFinanceDoc::Dump(CDumpContext& dc) const
{
	CDocument::Dump(dc);
}
#endif //_DEBUG

/////////////////////////////////////////////////////////////////////////////
// CFinanceDoc commands

// 
//--------------------------------------------------------------
CView* CFinanceDoc::GetView(CRuntimeClass *pClass)
{
	CView	   *pView;
	POSITION	pos=GetFirstViewPosition();
	
	while( pos != NULL )
	{
		pView=GetNextView(pos);
		if(pView->IsKindOf(pClass))
			break;
	}
	
	if(!pView->IsKindOf(pClass)){
		AfxMessageBox("Connt Locate the View.\r\n");
		return NULL;
	}
	
	return pView;
}
